{load header}

<!--/H-->
    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav --><!-- nav -->
            
	<div class="main-title">
        <h2>加息平台列表</h2>
    </div>
		<div class="cf">
		<!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
				<div class="drop-down">
					<span id="sch-sort-txt" class="sort-txt" data="{if $stname }{$stname}{/if}">{if $conname }{$conname}{else}所有{/if}</span>
					<i class="arrow arrow-down"></i>
					<ul id="sub-sch-menu" class="nav-list hidden">
						<li><a href="javascript:;" value="0">所有</a></li>
						<li><a href="javascript:;" value="1">平台中文名称</a></li>
                                                <li><a href="javascript:;" value="2">平台英文名称</a></li>
					</ul>
				</div>
				<input type="text" name="key" class="search-input" value="{if $keyname }{$keyname}{/if}" placeholder="请输关键词">
				<a class="sch-btn" href="javascript:;" id="search" url=""><i class="btn-search"></i></a>
			</div>
			<div class="btn-group-click adv-sch-pannel fl">
                <button class="btn">发布时间<i class="btn-arrowdown"></i></button>
                <div class="dropdown cf">
                	<div class="row">
                		<label>发布时间：</label>
                		<input type="text" id="time-start" name="time-start" class="text input-2x" value="{$time_start}" placeholder="起始时间" /> -                		
                        <div class="input-append date" id="datetimepicker"  style="display:inline-block">
                            <input type="text" id="time-end" name="time-end" class="text input-2x" value="{$time_end}" placeholder="结束时间" />
                            <span class="add-on"><i class="icon-th"></i></span>
                        </div>
                	</div>
                </div>
            </div>
		</div>
	    </div>
	<div class="data-table table-striped tab-content">
		<table>
			<thead>
				<tr>
					<th>平台名称</th>
					<th>英文名称</th>
                                        <th>LOGO</th>
                                        <th>企业/股东背景</th>
                                        <th>业务类型</th>
                                        <th>平台预期利息</th>
                                        <th>弹溜溜加息</th>
                                        <th>加息模式</th>
                                        <th>是否推荐</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<!--{loop $list $val}-->
				<tr>
					<td>{$val['name_ch']}</td>
					<td>{$val['name_en']}</td>
                                        <td><img height="30" src="{$val['logo_detail']}"></td>
                                        <td>
                                            <form action="{eval echo site_url('interests/modify_plat_bg')}" method="post">
                                            <input type="hidden" name="plat_en" value="{$val['name_en']}">
                                            <input type="text" name="plat_bg_str" class="text" value="{$val['plat_info']['plat_bg_str']}" style="width:100px;">
                                            </form>
                                        </td>
                                        <td>
                                            <form action="{eval echo site_url('interests/modify_plat_ywlx')}" method="post">
                                            <input type="hidden" name="plat_en" value="{$val['name_en']}">
                                            <input type="text" name="plat_ywlx_str" class="text" value="{$val['plat_info']['plat_ywlx_str']}" style="width:100px;">
                                            </form>
                                        </td>
                                        <td style="color:#FF9D00;font-size: 16px;">{$val['plat_interest']}</td>
					<td style="color:#FF9D00;font-size: 16px;">{$val['add_interest']}</td>
                                        <td >{if $val['is_interest_mode']}
                                            <a href="{eval echo site_url('interests/setmode')}?id={$val['id']}&mode=0"  title='点击取消' class="ajax-get">是</a>
                                            {else}
                                            <a href="{eval echo site_url('interests/setmode')}?id={$val['id']}&mode=1"  title='点击设置' style="color:red;" class="ajax-get">否</a>
                                            {/if}</td>
                                        <td>
                                            {if $val['is_recommend']}
                                            <a href="{eval echo site_url('interests/setrecommend')}?id={$val['id']}&recommend=0"  title='取消推荐' class="ajax-get">已推荐</a>
                                            {else}
                                            <a href="{eval echo site_url('interests/setrecommend')}?id={$val['id']}&recommend=1" style="color:red;" title='设置推荐' class="ajax-get">未推荐</a>
                                            {/if}
                                        </td>
                                        <td>
                                            <a href="{eval echo site_url('interests/qiyexinxi')}?key={$val['name_en']}">企业信息</a>&nbsp;|
                                            <a href="{eval echo site_url('interests/tuanduijieshao')}?key={$val['name_en']}">团队介绍</a>&nbsp;|
                                            <a href="{eval echo site_url('interests/gongsijieshao')}?key={$val['name_en']}">公司介绍</a>&nbsp;|
                                            <a href="{eval echo site_url('interests/pingtaifeiyong')}?key={$val['name_en']}">平台费用</a>&nbsp;|
                                            <a href="{eval echo site_url('interests/tupianziliao')}?key={$val['name_en']}">图片资料</a>&nbsp;|
                                            <a href="{eval echo site_url('interests/modify')}?id={$val['id']}">信息修改</a>&nbsp;|
                                            <a href="{eval echo site_url('interests/interfac')}?key={$val['name_en']}">接口管理</a>
                                            <a href="{eval echo site_url('interests/tiyanguize')}?key={$val['name_en']}">体验规则</a>
                                        </td>
                                        
				</tr>
				<!--{/loop}-->
			</tbody>
		</table>
		<!-- 分页 -->
	    <div class="page">
	        <div>
			{$showpage}
			<span class="rows">共 {$Total} 条记录</span>
                        <!--
                        <span class="rows" >金额总计 <font color="#F90">{$T_total['total']}</font> 元</span>
			<a target ="_blank;" href="{eval echo site_url('borrow/index_to_excel')}?{eval echo $_SERVER['QUERY_STRING'];}" >导出结果</a>
                        -->
                        
            </div>
		</div>
	</div>
	
			</div>
	</div>
<link href="{eval echo base_url()}static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="{eval echo base_url()}static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="{eval echo base_url()}static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="{eval echo base_url()}static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//$('#view_detail').click(function(id){
    function view_detail(id){
		$.thinkbox.defaults('style', 'default');
		$.thinkbox.iframe('{eval site_url('borrow/view')}id=?'+id,{
			'title' : ' ',
			'drag'  : true,
			"dataEle" : this,
			"height" : '',
			//"modal" : false,
			"unload":false,
			"button" : {'ok':'确 定', "cancel" : "取 消", "submit" : "提 交"}
		})

		//$.thinkbox.loading("提交成功");
		return false;
	}
//});
	
$(function(){
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
		var status = $("#sch-sort-txt").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
		if(status != ''){
			query += '&st=' + status;
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

	/* 状态搜索子菜单 */
	$(".search-form").find(".drop-down").hover(function(){
		$("#sub-sch-menu").removeClass("hidden");
	},function(){
		$("#sub-sch-menu").addClass("hidden");
	});
	$("#sub-sch-menu li").find("a").each(function(){
		$(this).click(function(){
			var text = $(this).text();
			$("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
			$("#sub-sch-menu").addClass("hidden");
		})
	});

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

    $('#time-start').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
	    minView:2,
	    autoclose:true
    });

    $('#datetimepicker').datetimepicker({
       format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true,
        pickerPosition:'bottom-left'
    })
	
    /* 实时更新分类信息 */
    $(".tab-content")
            .on("submit", "form", function(){
                    var self = $(this);
                    $.post(
                            self.attr("action"),
                            self.serialize(),
                            "json"
                    );
                    return false;
            })
            .on("focus","input",function(){
                    $(this).data('param',$(this).closest("form").serialize());

                })
            .on("blur", "input", function(){
                    if($(this).data('param')!=$(this).closest("form").serialize()){
                        $(this).closest("form").submit();
                    }
                });
    
})
</script>
<!--F-->{load footer}